#include<iostream>
#include<algorithm>
using namespace std;
const int N = 110;
struct Stu
{
	int gde;;
	string name;

}arr[N];
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> arr[i].gde >> arr[i].name;
	}
	
	cout << arr[n].name << endl;
	return 0;
}
